﻿using System;
using BookTheBook.Data.Model;

namespace BookTheBook.Web.Helpers
{
    

    public class StyleCalculator
    {
        private static readonly Random _randomNumberGenerator = new Random();
        private static int _greenCount;
        private static int _orangeCount;

        public static string CalculateCSSClassName(Book book)
        {
            int random = _randomNumberGenerator.Next(1, 3);
            if (random == 1)
            {
                _greenCount++;
                if ((_greenCount - _orangeCount) < 2)
                    return "green";
            }
            _orangeCount++;
            return "orange";
        }
    }
}
